package mclight.selectors;
import flash.display.DisplayObjectContainer;
import flash.events.Event;
import mclight.containers.Container;

class HUISlider extends UISlider
{
	var _valueLabelWidth:Int;
	
	public function new(
		?parent:DisplayObjectContainer, ?container:Container, x:Float = 0, y:Float = 0,
		label:String = "", defaultEventHandler:Event->Dynamic = null
	)
	{
		_valueLabelWidth = 40;
		_sliderClass = HSlider;
		super(parent, container, x, y, label, defaultEventHandler);
	}
	
	override function init()
	{
		super.init();
		setSize(200, 18);
	}
	
	// PUBLIC METHODS
	
	public override function draw()
	{
		formatValueText();
		_label.text = _labelText;
		_label.draw();
		_label.x = _width - _label.width + 5;
		_label.y = Std.int(_height - _label.height) >> 1;
		
		positionValueLabel();
		_slider.x = _valueLabelWidth;
		_slider.y = (height - _slider.height) * .5;
		_slider.width = width - _valueLabelWidth - _labelWidth - 5;
		_slider.draw();
		super.draw();
	}
	
	// HANDLERS
	
	// PROPERTIES
}